lib/kargs: Don't expose OstreeKernelArgs autoptr cleanup on old glib
authorDan Nicholson <nicholson@endlessm.com>
Fri, 26 Jul 2019 16:42:42 +0000 (10:42 -0600)
committerAtomic Bot <atomic-devel@projectatomic.io>
Sat, 27 Jul 2019 03:20:21 +0000 (03:20 +0000)
Move the OstreeKernelArgs autoptr cleanup definition to
ostree-autocleanups.h, which will only expose the definitions when
building ostree or if glib is new enough. The include of
ostree-kernel-args.h needs to be moved before ostree-autocleanups.h in
ostree.h so that the OstreeKernelArgs type is declared when the autoptr
cleanup is defined. All the places it's used already pull in libglnx.h
first so that the compat macros are picked up if glib it too old during
the ostree build.

Closes: #1892
Approved by: jlebon

src/libostree/ostree-autocleanups.h
src/libostree/ostree-kernel-args.h
src/libostree/ostree.h

index 9a54aee76640598f4cdd2e77a90744f065852536..c07f88a8794cc3acc24b8fe2c3008856a3bbcd1b 100644 (file)
@@ -51,6 +51,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeAsyncProgress, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeBootconfigParser, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeDeployment, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeGpgVerifyResult, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeKernelArgs, ostree_kernel_args_free)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeMutableTree, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepo, g_object_unref)
 G_DEFINE_AUTOPTR_CLEANUP_FUNC (OstreeRepoFile, g_object_unref)
index d7beca516f79ca20d5a8bcbe47dc719c7147d798..3975ae5c10a88b3be0477f3da85695909cf4438c 100644 (file)
@@ -35,8 +35,6 @@ GPtrArray *_ostree_kernel_arg_get_key_array (OstreeKernelArgs *kargs);
 _OSTREE_PUBLIC
 void ostree_kernel_args_free (OstreeKernelArgs *kargs);
 
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(OstreeKernelArgs, ostree_kernel_args_free)
-
 _OSTREE_PUBLIC
 OstreeKernelArgs *ostree_kernel_args_new (void);
 
index ca19bc853d5b340e13c429562be56fb8a201302b..49ca919c7f8d33f874b13fa7ecedf3ada165667b 100644 (file)
@@ -39,6 +39,6 @@
 #include <ostree-repo-finder-config.h>
 #include <ostree-repo-finder-mount.h>
 #include <ostree-repo-finder-override.h>
+#include <ostree-kernel-args.h>
 #include <ostree-autocleanups.h>
 #include <ostree-version.h>
-#include <ostree-kernel-args.h>